package org.softee.messaging.processor;

import java.util.ArrayList;
import java.util.List;

public class RouteBuilder {
    private List<Processor> processors = new ArrayList<Processor>();

    public Processor build() {
        return new CompoundProcessor(processors);
    }

    public RouteBuilder log(String prefix) {
        processors.add(new LogProcessor(prefix));
        return this;
    }

    public RouteBuilder multiply(int count) {
        processors.add(new MultiplyProcessor(count));
        return this;
    }

    public RouteBuilder append(String append) {
        processors.add(new AppendProcessor(append));
        return this;
    }

    public RouteBuilder filter(String pattern) {
        processors.add(new FilterProcessor(pattern));
        return this;
    }
}
